using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;

namespace SolutionOrchestrator.Validators
{
	static class DllsInFolder
	{
		static readonly Dictionary<string, string[]> _dic = new Dictionary<string, string[]>(StringComparer.InvariantCultureIgnoreCase);

		public static string[] Dlls(string solution)
		{
			string[] dlls;
			if (!_dic.TryGetValue(solution, out dlls))
			{
				_dic[solution] = dlls = Directory.GetFiles(solution, "*.dll", SearchOption.AllDirectories).Take(64).ToArray();
			}
			return dlls;
		}
	}
}